package com.bwie.controller;

import com.bwie.service.TbUserService;
import com.bwie.service.openFenService;
import com.bwie.utils.R;
import com.bwie.vo.LoginInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user/user")
public class TbUserController {
    @Autowired
    TbUserService tbUserService;
    @Autowired
    openFenService openFenService;

    /**
     * @Author: huliwen
     * @Date: 2025/5/19 9:24
     * 获取手机号验证码
     */
    @PostMapping("/gainCode/{userMobile}")
    public R gainCode(@PathVariable("userMobile") String userMobile){
        return tbUserService.gainCode(userMobile);
    }
    /**
     * @Author: huliwen
     * @Date: 2025/5/19 9:28
     * 手机号验证码验证登录
     */
    @PostMapping("/loginMobile")
    public R loginMobile(@RequestBody LoginInfoVo loginInfoVo){
        return tbUserService.loginMobile(loginInfoVo);
    }
/**
 * @Author: huliwen
 * @Date: 2025/5/19 16:26
 * 熔断
 */
    @PostMapping("/openFenUser/{id}")
    public R openFenUser(@PathVariable("id") Integer id){
        return openFenService.openFenUser(id);
    }


}
